<%= page_title "Environments" %>

<section class="clearfix tabs">
  <div class="table table-hover table-condensed">
    <table class="table">
      <thead>
      <tr>
        <th>Name</th>
        <th>Affects Production?</th>
        <th></th>
      </tr>
      </thead>

      <tbody>
        <% Environment.all.each do |env| %>
          <tr>
            <td>
              <%= link_to env.name, env %>
              <%= resource_lock_icon env %>
            </td>
            <td><%= env.production ? 'Yes' : 'No' %></td>
            <td>
              <%= link_to_delete env if can? :write, :environments %>
            </td>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>

  <div class="admin-actions">
    <div class="pull-right">
      <%= link_to "New", new_environment_path, class: "btn btn-default" %>
    </div>
  </div>
</section>
